<template>
  <div class="myheader">
      <div class="left">
          <span v-show="$store.state.user.username">昵称：{{$store.state.user.username}}</span>
      </div>
      <h2>{{title}}</h2>
  </div>
</template>

<script>
export default {
    name:'myheader',
    props:{
        title:''
    },
    data(){
        return{

        }
    }
}
</script>

<style lang="scss" scoped>
.myheader{
    width: 100%;
    height: 50px;
    display: flex;
    background-color: rgb(167, 243, 131);
    color: #fff;
    align-items: center;
    position: relative;
    .left{
        position: absolute;
        top: 0;
        left: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100%;
        padding: 0 10px;
    }
    h2{
        flex: 1;
    }
}

</style>